#pragma warning disable 108
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using Cephei;
using Cephei.Generic;
using Cephei.QL.Termstructures;
using Cephei.QL;
using Cephei.QL.Cashflows;
namespace Cephei.QL.Instruments
{
     // <summary> 
	// ! \ingroup instruments  \test - the correctness of the returned value is tested by checking that the price of a cap (resp. floor) decreases (resp. increases) with the strike rate. - the relationship between the values of caps, floors and the resulting collars is checked. - the put-call parity between the values of caps, floors and swaps is checked. - the correctness of the returned implied volatility is tested by using it for reproducing the target value. - the correctness of the returned value is tested by checking it against a known good value.
	// </summary>
    [Guid ("18542F63-D5C7-486a-87D2-20D51BD4C0AF"),ComVisible(true)]
	public interface ICapFloor : Cephei.QL.IInstrument
	{
		///////////////////////////////////////////////////////////////
        // Methods
        //
        
		 Double AtmRate(Cephei.QL.Termstructures.IYieldTermStructure discountCurve);
        
		 Cephei.IVector<Double> CapRates {get;}
        
		 Cephei.IVector<Cephei.QL.ICashFlow> FloatingLeg {get;}
        
		 Cephei.IVector<Double> FloorRates {get;}
        
		 Double ImpliedVolatility(Double price, Cephei.QL.Termstructures.IYieldTermStructure discountCurve, Double guess, Microsoft.FSharp.Core.FSharpOption<Double> accuracy, Microsoft.FSharp.Core.FSharpOption<UInt32> maxEvaluations, Microsoft.FSharp.Core.FSharpOption<Double> minVol, Microsoft.FSharp.Core.FSharpOption<Double> maxVol);
        
		 Boolean IsExpired {get;}
        
		 Cephei.QL.Cashflows.IFloatingRateCoupon LastFloatingRateCoupon {get;}
        
		 DateTime MaturityDate {get;}
        
		 Cephei.QL.Instruments.ICapFloor Optionlet(UInt64 n);
        
		 DateTime StartDate {get;}
        
		 QL.Instruments.CapFloor.TypeEnum Type {get;}
    }

    // <summary> 
	// ! \ingroup instruments  \test - the correctness of the returned value is tested by checking that the price of a cap (resp. floor) decreases (resp. increases) with the strike rate. - the relationship between the values of caps, floors and the resulting collars is checked. - the put-call parity between the values of caps, floors and swaps is checked. - the correctness of the returned implied volatility is tested by using it for reproducing the target value. - the correctness of the returned value is tested by checking it against a known good value. Factory
	// </summary>
   	[ComVisible(true)]
    public interface ICapFloor_Factory // : Collection_Factory<ICapFloor, ICell<ICapFloor>>
    {
        ///////////////////////////////////////////////////////////////
        // Factory methods
        //
        
	    ICapFloor Create (QL.Instruments.CapFloor.TypeEnum type, Cephei.IVector<Cephei.QL.ICashFlow> floatingLeg, Cephei.IVector<Double> strikes, Cephei.QL.IPricingEngine QL_Pricer);
        
	    ICapFloor Create (QL.Instruments.CapFloor.TypeEnum type, Cephei.IVector<Cephei.QL.ICashFlow> floatingLeg, Cephei.IVector<Double> capRates, Cephei.IVector<Double> floorRates, Cephei.QL.IPricingEngine QL_Pricer);
    }
}

